from building import *
import os

src = Glob('*.c')
cwd = GetCurrentDir()
inc = [os.path.join(cwd, 'include')]

src += Glob('kernel/*.c')
src += Glob('lib/*.c')
src += Glob('kernel/*.S')

src += Glob('kernel/v7m/*.c')
src += Glob('kernel/v7m/*.S')

group = DefineGroup('arch', src, depend=[''], CPPPATH=inc)

list = os.listdir(cwd)
for item in list:
    if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
        group = group + SConscript(os.path.join(item, 'SConscript'))

Return('group')
